function []=testing(Image)
I=double(Image);

H=size(I,1);
W=size(I,2);
R=I(:,:,1);
G=I(:,:,2);
B=I(:,:,3);

%%%%%%%%%%%%%%%%%% LIGHTING COMPENSATION %%%%%%%%%%%%%%%
YCbCr=rgb2ycbcr(I);
Y=YCbCr(:,:,1);

%normalize Y
minY=min(min(Y));
maxY=max(max(Y));
Y=255.0*(Y-minY)./(maxY-minY);
Yavg=sum(sum(Y))/(W*H);

T=1;
if (Yavg<64)
    T=1.4;
elseif (Yavg>192)
    T=0.6;
end

if (T~=1)
    RI=R.^T;
    GI=G.^T;
else
    RI=R;
    GI=G;
end

C=zeros(H,W,3);
C(:,:,1)=RI;
C(:,:,2)=GI;
C(:,:,3)=B;


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%% EXTRACT SKIN %%%%%%%%%%%%%%%%%%%%%%
YCbCrimage1=rgb2ycbcr(C);
Cr=YCbCrimage1(:,:,3);
[SkinIndexRow,SkinIndexCol] =find(10<Cr & Cr<45);

%finding the range for y ,cb ,cr part of the image
%calculating minimum value for the range
C=C/255;
C=im2uint8(C);
[r1 c1]=size(C);
for i=1:r1
    for j=1:c1
        C(i,j)=C(i,j)+16;
    end
end
YCbCrimage=rgb2ycbcr(C);   
Crpart=YCbCrimage(:,:,3);
ypart=YCbCrimage(:,:,1);
cbpart=YCbCrimage(:,:,2);



ymin=ypart(SkinIndexRow(1),SkinIndexCol(1));
cbmin=cbpart(SkinIndexRow(1),SkinIndexCol(1));
crmin=Crpart(SkinIndexRow(1),SkinIndexCol(1));
for i=1:length(SkinIndexRow)
    if (ymin>ypart(SkinIndexRow(i),SkinIndexCol(i)))
        ymin=ypart(SkinIndexRow(i),SkinIndexCol(i));
    end
    if (cbmin>cbpart(SkinIndexRow(i),SkinIndexCol(i)))
        cbmin=cbpart(SkinIndexRow(i),SkinIndexCol(i));
    end
    if (crmin>Crpart(SkinIndexRow(i),SkinIndexCol(i)))
        crmin=Crpart(SkinIndexRow(i),SkinIndexCol(i));
    end
end

%displaying minimum value of y cb and cr

%calculating maximum value for the range
ymax=ypart(SkinIndexRow(1),SkinIndexCol(1));
cbmax=cbpart(SkinIndexRow(1),SkinIndexCol(1));
crmax=Crpart(SkinIndexRow(1),SkinIndexCol(1));
for i=1:length(SkinIndexRow)
   
    if (ymax<ypart(SkinIndexRow(i),SkinIndexCol(i)))
        ymax=ypart(SkinIndexRow(i),SkinIndexCol(i));
    end
    if (cbmax<cbpart(SkinIndexRow(i),SkinIndexCol(i)))
        cbmax=cbpart(SkinIndexRow(i),SkinIndexCol(i));
    end
    if (crmax<Crpart(SkinIndexRow(i),SkinIndexCol(i)))
        crmax=Crpart(SkinIndexRow(i),SkinIndexCol(i));
    end
end

%displaying maximum value for the range

%finding average for y cb cr

ysum=0;
yavg=0;
cbsum=0;
cbavg=0;
crsum=0;
cravg=0;
for i=1:length(SkinIndexRow)   
    yvalues(i)=ypart(SkinIndexRow(i),SkinIndexCol(i));
    cbvalues(i)=cbpart(SkinIndexRow(i),SkinIndexCol(i));
     crvalues(i)=Crpart(SkinIndexRow(i),SkinIndexCol(i));
end
ysum=sum(yvalues);
yavg =ysum/length(SkinIndexRow);
yavg=uint8(yavg);
cbsum=sum(cbvalues);
cbavg =cbsum/length(SkinIndexRow);
cbavg=uint8(cbavg); 
crsum=sum(crvalues);
cravg =crsum/length(SkinIndexRow);
cravg=uint8(cravg);

m=0;
if 35<=ymin 
    m=m+1;
end
if ymin<=50
    m=m+1;
end
if 85<=cbmin
    m=m+1;
end
if cbmin<=115
    m=m+1;
end
if 210<=ymax 
    m=m+1;
end
if ymax<=235 
    m=m+1;
end
if 120<=cbmax
    m=m+1;
end
if cbmax<=150 
    m=m+1;
end
if 165<=crmax 
    m=m+1;
end
if crmax<=172 
    m=m+1;
end
  if 100<=yavg
      m=m+1;
  end
  if yavg<=175 
      m=m+1;
  end
  if 100<=cbavg 
      m=m+1;
  end
  if  cbavg<=125
      m=m+1;
  end
  if 140<=cravg
      m=m+1;
  end
  if cravg<=160
m=m+1;
  end

 ymin=uint8(ymin);
  ymax=uint8(ymax);
  cbmin=uint8(cbmin);
  cbmax=uint8(cbmax);
  crmin=uint8(crmin);
  crmax=uint8(crmax);
  
  
  ymin
  cbmin
  crmin
  ymax
  cbmax
  crmax
  yavg
  cbavg
  cravg
if m<15
q=0;
else
    q=1;
end

q